/*************** modernisations ****************/ var ws_alphabet = { 'pt':'a-záàâãçéêẽíóòôõq̃úűA-ZÁÀÂÃÇÉÊẼÍÓÒÔÕQ̃ÚŰĩq̃ĨQ̃', 'pt-br':'a-záàâãçéêẽíóòôõq̃úűA-ZÁÀÂÃÇÉÊẼÍÓÒÔÕQ̃ÚŰĩq̃ĨQ̃', 'fr':'a-zçâàäāãéèêẽëîïôöōõûùüÿœæA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜŸÇŒÆ&ßĩq̃ĨQ̃', 'es':'a-zçâàäãéèêẽëîïôöõûùüÿœæñA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜŸŒÆÑ&ß' } var dictionary_page = { 'pt':'Wikisource:Dicionário', 'pt-br':'Wikisource:Dicionário/pt-br', 'fr':'Wikisource:Dictionnaire', 'es':'Wikisource:Diccionario' } var user_lang = false; var lang = user_lang? wgUserLanguage : wgContentLanguage; var re_alphabet = RegExp("([^" + ws_alphabet[lang] + "]+)", ""); function mod_text(text) { text = text.replace(/ſ/g, "s"); text = text.replace(/ff/g, "ff"); text = text.replace(/fl/g, "fl"); text = text.replace(/fi/g, "fi"); text = text.replace(/ffi/g, "ffi"); text = text.replace(/ffl/g, "ffl"); text = text.replace(/ſt/g, "st"); text = text.replace(/st/g, "st"); //text = text.replace(/ß/g, "ss"); return text; } function mod_node(node) { if (node.nodeType == 3) { node.data = mod_text(node.data); } else { for (var i=0; i lastLastIndex) { output.push(str.slice(lastLastIndex, match.index)); // fix browsers whose `exec` methods don't consistently return `undefined` for nonparticipating capturing groups if (!compliantExecNpcg && match.length > 1) { match[0].replace(separator2, function () { for (var i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } if (match.length > 1 && match.index < str.length) Array.prototype.push.apply(output, match.slice(1)); lastLength = match[0].length; lastLastIndex = lastIndex; } if (separator.lastIndex === match.index) separator.lastIndex++; // avoid an infinite loop } if (lastLastIndex === str.length) { if (!separator.test("") || lastLength) output.push(""); } else { output.push(str.slice(lastLastIndex)); } return output; } function mod2_text(text, dict, build, udict) { list = reg_split(text, re_alphabet); text = ""; var prev_w=""; for (var i=0, len=list.length; i\s*(\S[^:]*?)(\s| )*:\s*([\S].*?)\s*<\/li>$/i.exec(lines[i]) if( match2 ) { wsdict[match2[1]]=match2[3]; continue; } } mod2_node(document.getElementById('content'), wsdict, false, null); } li_a = document.getElementById("mod_option").firstChild; if(li_a) li_a.innerHTML="Texte original"; } function do_mod(){ if(!(wgNamespaceNumber == 0 || wgNamespaceNumber == 2 || wgNamespaceNumber == 14 || wgNamespaceNumber == 102 || wgNamespaceNumber == 104)) return; url = wgServer + '/w/api.php?action=query&format=json&prop=revisions&titles=' + dictionary_page[lang] + '&rvprop=content&callback=do_mod_callback'; importScriptURI(url); } function mod_lookup() { var mm=document.getElementById("modernisations"); if ( mm && wgNamespaceNumber == 0 ) { var optlist = get_optlist(); addPortletLink ('p-displayOptions', 'javascript:do_mod();', 'Texte modernisé', 'mod_option' ); } } addOnloadHook(mod_lookup); if(self.gadget_typographie && !self.gadget_mod2) addOnloadHook(mod_typo_document);